package com.hailiao.beidou.message.data.store.contant

import com.hailiao.beidou.comm.bluetooth.BLEHub
import com.hailiao.beidou.comm.serialport.SPHub
import com.hailiao.beidou.core.model.BDHub

/**
 * 通讯模式
 * @Author d10ng
 * @Date 2024/3/4 16:24
 */
enum class CommunicationMode(val value: Int, val text: String, val hub: BDHub) {

    BLE(1, "蓝牙通讯", BLEHub),

    SERIAL_PORT(2, "串口通讯", SPHub),

    ;

    companion object {
        fun parse(value: Int) = entries.firstOrNull { it.value == value } ?: BLE
    }
}